package com.cleaningcloud.erp.api.utils;

import com.cleaningcloud.common.core.utils.DateUtils;
import com.cleaningcloud.erp.api.domain.ErpCommodityStockAlter;

import java.math.BigDecimal;

public class StockCommodityAlterUtils {

    public static ErpCommodityStockAlter AssemblyInfo(Long commodityId, BigDecimal commodityNumber, String operateType, Long wareId) {
        ErpCommodityStockAlter erpCommodityStockAlter = new ErpCommodityStockAlter();
        erpCommodityStockAlter.setCommodityId(commodityId);
        erpCommodityStockAlter.setCommodityNumber(commodityNumber);
        erpCommodityStockAlter.setOperateType(operateType);
        erpCommodityStockAlter.setWareId(wareId);
        erpCommodityStockAlter.setCreateTime(DateUtils.getNowDate());
        String operateTypeName = "";
        if ("1".equals(operateType)) {
            operateTypeName = "入库";
        } else if ("2".equals(operateType)) {
            operateTypeName = "出库";
        } else if ("3".equals(operateType)) {
            operateTypeName = "调拨";
        } else if ("4".equals(operateType)) {
            operateTypeName = "消耗";
        } else if ("5".equals(operateType)) {
            operateTypeName = "报损";
        } else if ("6".equals(operateType)) {
            operateTypeName = "报溢";
        }
        erpCommodityStockAlter.setRemark("商品" + operateTypeName + ",数量：" + commodityNumber);
        return erpCommodityStockAlter;
    }
}
